package com.hnevc.xiewenguang;
    /**
     *
     * 找到x
     *
     */
import java.util.Scanner;
    public class Eaxmple01{
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.print("请输入一个数:");
        int n=sc.nextInt(),x=1,y=2;
        while (n!=0){
            if (n <=1 ||n%2==0) {
                System.out.println("2^? mod"+n+"=1");
                break;
            }
            while (y!=1){
                x++;
                y+=y;
                y%=n;

            }
            System.out.println("2^"+x+ "mod"+n+"=1");
            break;
        }
    }
}